# -*- coding: utf-8 -*-
"""
Created on Fri Nov 17 15:41:48 2017

@author: JanComputer
"""
from .Parser import Parser
from bs4 import BeautifulSoup
from urllib.parse import urljoin
class ParserNeiHan8(Parser):
    def paserHtml(self):
        if self.data:
            data=self.data
            text=data.get('text')
            netloc=data.get('netloc')
            taga=None
            next_url=None
            if text is not None:
                bs=BeautifulSoup(text,'lxml')
                taga=bs.select('.desc')
                next_url=bs.select_one('.next')
                if next_url is not None:
                    next_url=urljoin(netloc,next_url['href'])
                return {'jokes':taga,'next_url':next_url}
